﻿#region System Namespace
using System;
using System.Linq;
using System.Threading;
#endregion System Namespace

#region Foreign Namespace
#endregion Foreign Namespace

#region Styx Namespace
using Styx;
using Styx.Plugins;
using Styx.WoWInternals.WoWObjects;
using Styx.CommonBot.Frames;
using Styx.WoWInternals;
#endregion Styx Namespace

namespace Auction
{
    public partial class Auction : HBPlugin
    {
        public WoWPoint MoveToMailbox()
        {
            try
            {
                var mailboxes = ObjectManager.GetObjectsOfType<WoWGameObject>(false, false).Where(o => o != null && o.Entry == MIRsettings.Instance.MailboxID).ToList();
                foreach (WoWGameObject obj in mailboxes.Where(obj => obj != null))
                {
                    return obj.Location;
                }
            }
            catch (Exception e)
            {
                Log("Error: " + e.Message);
                return WoWPoint.Empty;
            }
            return WoWPoint.Empty;
        }
    }
}